function saveFigureAsIs(h,outfilename)
% saveFigureAsIs(h,outfilename) Saves the figure h without the white
%   space/margin around it to the file OUTFILENAME. 

set(h,'Units','inches');
screenposition = get(h,'Position');
set(h,...
    'PaperPosition',[0 0 screenposition(3:4)],...
    'PaperSize',[screenposition(3:4)])
saveas(h, outfilename);


